home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / science / mndlbrtm.sit / MandelbrotMS.rsrc / øFm4_132_Mandelbrot (MS) < prev   
Text File  |  1991-02-07  |  2KB  |  30 lines

  1. ------------------------------ Mandelbrot (MS) ------------------------------
  2.  
  3. This EDP computes images of the Mandlbrot Set using the Mariani-Silver algorithm.
  4. This algorithm is based on the assumption that a rectangle in the complex plane,
  5. whose outline is all the same colour, must be entirely of that colour. It then becomes
  6. possible to colour the interior of the rectangle without calculating its pixels.
  7. This algorithm is not guaranteed to give correct images of the Mandelbrot Set - that
  8. is, the assumption above is not generally true when the complex plane is only
  9. sampled in a discrete fashion - but you will find that it works nicely all the same.
  10.  
  11. The implementation works as follows:
  12. Ñ To colour a rectangle, scan the center point and all four corners. Then scan all the
  13. edges. If any sampled pixel has a different colour than the center one, split the
  14. rectangle into four equal parts and retry the procedure on each quarter separately.
  15. Ñ If a rectangle's outline and center point all have the same pixel value, fill the
  16. rectangle entirely with this colour.
  17. Ñ If a rectangle that is less than 5 pixels wide or high is encountered in this
  18. procedure, calculate all its pixels individually (do not recurse further).
  19. Ñ Before calculating a pixel value (that is, applying the z := z^2 + c iteration to it),
  20. check the pixel map to see if it has been calculated already. Unknown pixels are
  21. recognized by their value (0); if a pixel has been calculated, it has a value ranging
  22. from 1 to 255.
  23. Ñ The iteration routine is written in assembly language for maximum speed, as is the
  24. rectangle fill routine. According to the required accuracy, fixed or floating point
  25. calculation modes are used, as in the standard "MBFast" EDP.
  26. Ñ Because the algorithm must be able to get information from the pixel map, to see
  27. whether a pixel has already been calculated, black and white operation is not
  28. supported. In a bitmap, each pixel can have only two different values, so you could
  29. only generate solid black images, since white has a special meaning.
  30. Ñ Apart from the only-colour restriction, this EDP is used exactly like MBFast.